<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
  {% if currentRecipe %}
  <title>{{ currentRecipe.name }} Recipe - {{ currentRecipe.category }} - ServiceWorker Cookbook</title>
  {% else %}
  <title>ServiceWorker Cookbook</title>
  {% endif %}
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <link rel="stylesheet" href="tabzilla.css">
  <link rel="stylesheet" href="bundle.css">
  <script type="text/javascript" src="bundle.js" defer></script>
</head>
<body>

  <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-49796218-37', 'auto');
  ga('send', 'pageview');
  </script>

  <div class="book with-nav">
    <nav><div class="recipes-cover">
      <div id="tabzilla">
        <a href="https://www.mozilla.org/">Mozilla</a>
      </div>

      <ul class="recipes">
        <li><a href="/">Introduction</a></li>
        <li><a href="https://github.com/mozilla/serviceworker-cookbook/">Contribute on GitHub</a></li>

          {% for category in categories %}
            <li class="category"><a href="{{ category.slug }}.html">{{ category.title }}</a></li>
            {% for recipe in recipes %}
              {% if recipe.category == category.title %}
              <li>
                <a href="{{ recipe.intro_ref }}">
                  <span class="ball-difficulty-{{ recipe.difficulty }}" title="Difficulty: {{ recipe.difficultyTerm }}">
                    {% if recipe.difficulty === 1 %}
                    B
                    {% elif recipe.difficulty === 2 %}
                    I
                    {% elif recipe.difficulty === 3 %}
                    A
                    {% endif %}
                  </span>
                  {{ recipe.name }}
                </a>
              </li>
              {% endif %}
            {% endfor %}
          {% endfor %}
      </ul>
    </div></nav>
    <main>
      <header>
        <div class="nav-top">
          <div class="item">
            <button id="navToggle" class="fi-list large"></button>
          </div>
          <div class="tabs">
            {% if currentRecipe %}
              <div class="item"><a href="{{ currentRecipe.intro_ref }}">Readme</a></div>
              <div class="item"><a href="{{ currentRecipe.demo_ref }}">Demo <button class="demo-launch" data-href="{{ currentRecipe.demo_index }}"><img src=""></button></a></div>
              <div class="item" style="flex-grow: 1;"></div>
              {% for src in currentRecipe.srcs %}
                <div class="item"><a href="{{ src.ref }}">{{ src.name }}.js</a></div>
              {% endfor %}
            {% endif %}
          </div>
        </div>
      </header>
      <div class="main-inner">
        {% autoescape false %}{{ content }}{% endautoescape %}
        <hr/>
        <h2>Has it been useful?</h2>
       <p>Tell us what you think of this recipe by leaving a comment!</p>
        <aside id="disqus_thread"></aside>
        <script>
         // https://disqus.com/admin/universalcode/#configuration-variables
         var disqus_config = function () {
          this.page.identifier = '{{ currentRecipe.slug }}';
         };
         (function() { // DON'T EDIT BELOW THIS LINE
           var d = document, s = d.createElement('script');
           s.src = '//serviceworkers.disqus.com/embed.js';
           s.setAttribute('data-timestamp', +new Date());
           (d.head || d.body).appendChild(s);
         })();
        </script>
        <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
      </div>
    </main>
  </div>
</body>
</html>
